<script lang="ts" setup>
const contactMethods = [
  {
    title: "微信",
    desc: "F994637",
    svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#07c160" width="40" height="40"><path d="M12 2C6.48 2 2 5.91 2 10.5c0 2.35 1.28 4.44 3.28 5.85L4 20l4.07-2.15C9.24 18.3 10.59 18.5 12 18.5c5.52 0 10-3.91 10-8.5S17.52 2 12 2z"/></svg>`,
  },
  {
    title: "百家号",
    desc: `<a target="_blank" href="https://baijiahao.baidu.com/s?id=1763591557096121056">百家号</a>`,
    svg: `<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 1024 1024" fill="#3b8cff"><path d="M784 96H240c-79.5 0-144 64.5-144 144v544c0 79.5 64.5 144 144 144h544c79.5 0 144-64.5 144-144V240c0-79.5-64.5-144-144-144zM288 736V288h64v448h-64zm192 0V288h64v448h-64zm192 0V288h64v448h-64z"/></svg>`

  },
  {
    title: "掘金",
    desc: `<a target="_blank" href="https://juejin.cn/">掘金</a>`,
    svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" fill="#1e80ff" width="40" height="40"><path d="M512 64L64 512l448 448 448-448L512 64z"/></svg>`,
  },
  {
    title: "邮箱",
    desc: `<a target="_blank" href="mailto:fengpan498@gmail.com">fengpan498@gmail.com</a>`,
    svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ff6600" width="40" height="40"><path d="M20 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V6a2 2 0 00-2-2zm0 2v.01L12 13 4 6.01V6h16z"/></svg>`,
  },
];
</script>

<template>
  <div class="contact-section">
    <h2>随时与我们联系</h2>
    <p class="contact-subtitle">如果您有任何问题或建议，我们很乐意与您交流。</p>

    <div class="contact-list">
      <div class="contact-item" v-for="(item, i) in contactMethods" :key="i">
        <div class="contact-icon" v-html="item.svg"></div>
        <div class="contact-title">{{ item.title }}</div>
        <div class="contact-desc" v-html="item.desc"></div>
        <!-- <a href="">22</a> -->
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.contact-section {
  margin-top: 80px;
  text-align: center;
  padding: 0 16px;

  h2 {
    font-size: 38px;
    font-weight: bold;
    text-align: center;
    margin: 40px 0 20px;
    background: linear-gradient(90deg, #ff6ec4, #7873f5, #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
  }

  .contact-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
  }

  .contact-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    justify-content: center;

    @media (max-width: 1024px) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (max-width: 768px) {
      grid-template-columns: repeat(1, 1fr);
    }
  }

  .contact-item {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;

    &:hover {
      border-color: #007bff;

      .contact-title {
        color: #007bff;
      }
    }

    .contact-icon {
      margin-bottom: 12px;

      img {
        width: 40px;
        height: 40px;
        object-fit: contain;
      }
    }

    .contact-title {
      font-size: 16px;
      font-weight: bold;
      margin-bottom: 4px;
      color: #333;
      transition: color 0.3s ease;
    }

    .contact-desc {
      font-size: 14px;
      color: #666;
    }
  }
}
</style>